<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script src="jquery.js"></script>
	<script src="tableExport.js"></script>
	<script src="jquery.base64.js"></script>
	<script type="text/javascript" src="jspdf/libs/sprintf.js"></script>
<script type="text/javascript" src="jspdf/jspdf.js"></script>
<script type="text/javascript" src="jspdf/libs/base64.js"></script>
	<style>
		table{
			width: 100%;
			border: 1px solid #ccc;
			text-align: center;
		}
		td{
			border: 1px solid #ccc;
		}
	</style>
</head>
<body>
	<a href="#" onClick ="$('table').tableExport({type:'excel', separator:';', escape:'false'});" id="buttonExportData">Export XLS</a>
	<button onclick="$('table').tableExport({type:'pdf',escape:'false'});">导出pdf</button>
	<table>
		<thead>
			<tr>
				<th>1</th>
				<th>2</th>
				<th>3</th>
				<th>4</th>
			</tr>
		</thead>
		<tbody>
			
			<tr>
				<td>1</td>
				<td>1</td>
				<td>1</td>
				<td>1</td>
			</tr>
			<tr>
				<td>2</td>
				<td>2</td>
				<td>2</td>
				<td>2</td>
			</tr>
			<tr>
				<td>3</td>
				<td>4</td>
				<td>3</td>
				<td>3</td>
			</tr>
			<tr>
				<td>1</td>
				<td>2</td>
				<td>3</td>
				<td>4</td>
			</tr>
			<tr>
				<td>5</td>
				<td>6</td>
				<td>7</td>
				<td>8</td>
			</tr>
		</tbody>
	</table>
</body>
</html>